07-Operators example 2.py


Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...


Code Snippet

print (2.0 + 4.0)
print (6.0 - 4.0)
print (6.0 * 3.0)
print (6.0 / 3.0)
print (6.0 % 3.0)
print (6.0 // 3.0) # floor division: always truncates fractional remainders
print (-5.0)
print (3.0**2.0)   # three to the power of 2                    

Try it yourself